using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Security;

namespace XCommon.utils
{
    public class SecurityUtil
    {
        public const string EmptyMD5 = "00000000000000000000000000000000";

        public static string MD5(string text)
        {
            if (string.IsNullOrEmpty(text))
                return EmptyMD5;

            return FormsAuthentication.HashPasswordForStoringInConfigFile(text, "MD5").ToLower();
        }
    }
}
